﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;

namespace Cms.Core.Application.Service.PermissionInfo.Dto
{
    /// <summary>
    /// 菜单
    /// </summary>
  public  class MenuDto
    {

        public MenuDto(PermissionModuleDto dto)
        {
            MenuId = dto.Id;
            Name = dto.Name;
            Path = dto.Path;
            ParentId = dto.ParentId;
            OrderSort = dto.OrderSort;
            Icon = dto.Icon;
            Children = new List<MenuDto>();
            Meta = new { requireAuth = true };
        }

        [JsonProperty("menuId")]
        public Guid MenuId { get; set; }

        [JsonProperty("name")]
        public string Name { get; set; }

        [JsonProperty("path")]
        public string Path { get; set; }


        [JsonProperty("parentId")]
        public Guid? ParentId { get; set; }

        [JsonProperty("orderSort")]
        public int OrderSort { get; set; }


        [JsonProperty("iconCls")]
        public string Icon { get; set; }

        [JsonProperty("children")]
        public List<MenuDto> Children { get; set; }
        [JsonProperty("meta")]
        public object Meta { get; set; }


    }
}
